package com.sk.bilibili.apiMapper.factory;

import com.sk.bilibili.apiMapper.ApiMapper;
import lombok.Data;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author 邵康
 * @date 2021/8/9 14:38
 */
@Data
public class ApiMapperFactoryBean<T> implements FactoryBean<T> {

    private Class<T> targetClass;
    private ApiMapper apiMapper;

    @Override
    public T getObject() throws Exception {
        return apiMapper.create(targetClass);
    }

    @Override
    public Class<?> getObjectType() {
        return targetClass;
    }

}
